import request from "@/utils/request";

// 角色列表
export function roleListApi(params) {
  return request({
    url: "/auth/role",
    method: "get",
    params,
  });
}
// 添加角色
export function addroleListApi(data) {
  return request({
    url: "/auth/role",
    method: "post",
    data,
  });
}
// 获取权限列表
export const getMenuListApi = () => {
  return request({
    url: "/auth/menu",
    method: "get",
  });
};

// 角色权限列表
export function editRoleListApi(id) {
  return request({
    url: `/auth/role/${id}`,
    method: "get",
  });
}

// 修改角色
export function editRoleApi(data) {
  return request({
    url: `/auth/role/${data.id}`,
    method: "put",
    data,
  });
}

// 删除角色
export function delRoleApi(id) {
  return request({
    url: `/auth/role/${id}`,
    method: "delete",
  });
}
